import React, { Component } from 'react';
import {NavLink  } from 'react-router-dom'

import './SwitchTab.scss'
class SwicthTab extends Component {
    constructor(props) {
        super(props);
        this.state = { 
            tabs:[
                {url:'/store/home',name:'商品'},
                {url:'/store/evaluation',name:'评价'},
                {url:'/store/businessdetails',name:'商家'},
            ]
        }
    }


    render() {
        return (
            <div className="switchTab">
                {this.state.tabs.map((el,index)=>{
                     return <NavLink to={el.url} key={index} activeClassName="tab-active" exact className="tab">{el.name}</NavLink>
                })}
            </div>
        );
    }
}
 
export default SwicthTab;